/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

package com.huawei.housekeeper.common.constants;

import lombok.Getter;
import lombok.Setter;

/**
 * 功能描述 销售属性枚举类
 *
 * @author jWX1116205
 * @since 2022-01-05
 */
public enum SellNatureEnum {

    SELL_NATURE_NO("N", "没有销售属性"),
    SELL_NATURE_YES("Y", "有销售属性"),
    ;

    // 操作代码
    @Setter
    @Getter
    String code;

    // 提示信息
    @Setter
    @Getter
    String message;

    private SellNatureEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public SellNatureEnum findByCode(String code) {
        for (SellNatureEnum testEnum : SellNatureEnum.values()) {
            if (testEnum.getCode().equalsIgnoreCase(code)) {
                return testEnum;
            }
        }
        return null;
    }

}